using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_AccountTemplateMap : EntityTypeConfiguration<t_AccountTemplate>
    {
        public t_AccountTemplateMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FType, t.FAcctID });

            // Properties
            this.Property(t => t.FType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FAcctID)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FAcctName)
                .IsRequired()
                .HasMaxLength(160);

            // Table & Column Mappings
            this.ToTable("t_AccountTemplate");
            this.Property(t => t.FType).HasColumnName("FType");
            this.Property(t => t.FAcctID).HasColumnName("FAcctID");
            this.Property(t => t.FAcctName).HasColumnName("FAcctName");
            this.Property(t => t.FGroup).HasColumnName("FGroup");
            this.Property(t => t.FDC).HasColumnName("FDC");
            this.Property(t => t.FIsCash).HasColumnName("FIsCash");
            this.Property(t => t.FIsBank).HasColumnName("FIsBank");
        }
    }
}
